//
//  EmployerCommentTool.m
//  ForestPack
//
//  Created by jimmy on 2018/8/7.
//  Copyright © 2018年 郑洲. All rights reserved.
//

#import "EmployerCommentTool.h"

@implementation EmployerCommentTool

///这是评价进度和标签的接口
+(void)requestCommentShowDataWithGoods_id:(NSInteger)goods_id withType:(NSInteger )type success:(void (^)(EmployerCommentModel * employerCommentModel))successBlock
{
    NSString *url = [NSString stringWithFormat:@"%@app/comment_index",REQUESTHEADER];
    NSDictionary *dict = @{@"goods_id":@(goods_id),@"type":@(type),@"token":[FPLoginAndRegisterTools getToken]};
    [HttpManager postHttpRequestByPost:url andParameter:dict success:^(id successResponse) {
        NSDictionary *dic = successResponse;
        NSString *status = [NSString stringWithFormat:@"%@",dic[@"status"]];
        if ([status isEqualToString:@"1"]) {
            NSError *error;
            EmployerCommentModel * employerCommentModel = [[EmployerCommentModel alloc] initWithDictionary:dic error:&error];
            if (successBlock) {
                successBlock(employerCommentModel);
            }
        }else {
            [HttpManager showNoteMsg:[NSString stringWithFormat:@"%@",successResponse[@"msg"]]];
        }
    } andFailure:^(id failureResponse) {
        [HttpManager showFail];
    }];
}

@end
